import json


def usercheck(a1, a2):
    import urllib.parse
    import urllib.request
    import ssl

    host = 'https://idenauthen.market.alicloudapi.com'
    path = '/idenAuthentication'
    method = 'POST'
    appcode = 'c01cb23b7d2640f19c336485a5c0144c'
    querys = ''
    bodys = {}
    url = host + path

    bodys['idNo'] = a2
    bodys['name'] = a1
    post_data = urllib.parse.urlencode(bodys).encode('utf-8')  # 注意这里需要将数据编码为字节串

    request = urllib.request.Request(url, post_data)
    request.add_header('Authorization', 'APPCODE ' + appcode)
    request.add_header('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8')

    # 禁用SSL证书验证
    ctx = ssl.create_default_context()
    ctx.check_hostname = False
    ctx.verify_mode = ssl.CERT_NONE

    response = urllib.request.urlopen(request, context=ctx)
    content = response.read().decode('utf-8')  # 将字节串解码为字符串

    return json.loads(content)